package pc29;

import java.util.Scanner;

public class J10SungJuk {
	public static void main(String[] args) {

		int kor;
		int eng;
		int mat;
		int tot;
		double avg;
		char grd;
		String name = "";

		name = inputname(makeScanner());
		kor = inputkor(makeScanner());
		eng = inputeng(makeScanner());
		mat = inputmat(makeScanner());

		tot = gettot(kor, eng, mat);
		avg = getavg(tot);
		grd = getgrd(avg);

		System.out.println("이름 : " + name);
		System.out.println("총점 : " + tot);
		System.out.println("평균 : " + avg);
		System.out.print("학점 : " + grd);
	}

	public static Scanner makeScanner() {
		Scanner sc = new Scanner(System.in);
		return sc;
	}

	public static void closeScanner(Scanner sc) {
		sc.close();
	}

	private static String inputname(Scanner sc) {
		String name;
		System.out.println("이름입력해");
		name = sc.next();
		return name;
	}

	private static int inputkor(Scanner sc) {
		int kor;
		System.out.println("국어점수입력해");
		kor = sc.nextInt();
		return kor;

	}

	private static int inputeng(Scanner sc) {
		int eng;
		System.out.println("영어점수입력해");
		eng = sc.nextInt();
		return eng;

	}

	private static int inputmat(Scanner sc) {
		int mat;
		System.out.println("수학점수입력해");
		mat = sc.nextInt();
		closeScanner(sc);
		return mat;

	}

	public static int gettot(int kor, int eng, int mat) {
		int tot;
		tot = kor + eng + mat;
		return tot;

	}

	public static double getavg(int tot) {
		double avg;
		avg = tot / 3;
		return avg;

	}

	public static char getgrd(double avg) {
		char grd;
		switch ((int) avg / 10) {
		case 10:
		case 9:
			grd = '수';
			break;
		case 8:
			grd = '우';
			break;
		case 7:
			grd = '미';
			break;
		case 6:
			grd = '양';
			break;
		default:
			grd = '가';
		}
		return grd;

	}
}
